package com.aaa.order.service.impl;

import com.aaa.entity.Order;
import com.aaa.order.dao.OrderDao;
import com.aaa.order.service.IOrderService;
import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @program: qy156-shop-parent
 * @description:
 * @author: 闫克起2
 * @create: 2022-11-18 14:36
 **/
@Service
public class OrderService implements IOrderService {

    @Autowired
    private OrderDao orderDao;
    @Override
    public int save(Order order) {
        return orderDao.insert(order);
    }

    @Override
    @SentinelResource("queryGood") //默认sentinel对controller的路径设置为资源  如果向对象别的层中的方法设置为资源需要添加该注解SentinelResource。
    public void queryGood() {
    }

    @Override
    public Order findOrderById(Long oid) {
        return orderDao.selectById(oid);
    }
}
